
//获取页面url参数
function getParam(){
	var c1,c2,c3;
	c1 = window.location.href.split("?")[1];
	var requestParam = c1.split("&");
	c2 = requestParam[0].split("=")[1];//ci
	c3 = requestParam[1].split("=")[1];//id
	var params = {};
	params.ci = c2;
	params.id = c3;
	getData(params);
}
getParam();
function getData(param){
	var mess_url = '/citrusmonitor/distri.do?method=branch&ci='+param.ci+'&id='+param.id;//后台填充
	$.ajax({
		type:'get',
		url:mess_url,
		dataType:'json',
		success:function(data){
			var title_box = document.getElementsByClassName("title_box")[0];
			var content_box = document.getElementsByClassName("content_box")[0];
			var html_tit = '';
			var html_con = '';
			var changeText = '';
			if(data["distribution"] != undefined){
				changeText = '<span class="source"><span>&nbsp;&nbsp;来源：</span><span>'+data["distribution"]+'</span></span>';
			}
			html_tit = '<h1 class="title">'+data["title"]+'</h1><div class="title_detail"><span class="time"><span>发布时间：</span><span>'+data["time"]+'</span></span>'+changeText+'</div>';
			if(data["filePath"] != null && data["filePath"] != ''){
				html_con ='<img src="'+data["filePath"]+'">'+ data["content"];
			}
			else{
				html_con = data["content"];	
			}				
			title_box.innerHTML =html_tit;
			content_box.innerHTML=html_con;
			
		},
		error:function(){
			alert("资源加载失败！！");
		}
	});
}
